
package com.pmsystem.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.pmsystem.dao.FreeCarMapper;
import com.pmsystem.pojo.FreeCar;

@Service
public class FreeCarService {
	@Autowired
	FreeCarMapper freeCarMapper;
	/**  
	 * <p>Title: addFreeCar</p >  
	 * <p>Description:业主登记绑定车辆< </p >  
	 * @author 魏家洛
	 * @param freeCar
	 * @return  
	 */  
	public boolean addFreeCar(FreeCar freeCar) {
		return freeCarMapper.insertFreeCar(freeCar);
	}
	/**  
	 * <p>Title: findAllCar</p >  
	 * <p>Description: 查询对应业主id的所有车辆信息</p >  
	 * @author 魏家洛
	 * @return  
	 */  
	public List<FreeCar> findAllCar(Integer userId) {
		return freeCarMapper.selectCarByUserId(userId);
	}
	/**  
	 * <p>Title: checkCarIsUsers</p >  
	 * <p>Description:检查车牌是否属于小区业主</p >  
	 * @author 魏家洛
	 * @param license
	 * @return  
	 */  
	public boolean checkCarIsUsers(String license) {
		return (freeCarMapper.isExistLicense(license)!=0);
	}
}

